This is an XFCN that will search for the last occurance of a character in a string of characters and return its position. If it is not found, it will return -1.
Unlike HyperCard's offset command, which returns the first found position, LastOffset returns the last found position.
This is free. All I ask is to be notified of any suggestions or bugs found, and a credit line if you use it in released stacks. C source available on request.
Copyright 1988. All rights reserved.
Dwight Mayo
GEnie, MacNet - DMAYO
Compuserve - 76257,3303
-- part contents for background part 7
----- text -----
Syntax:
LastOffset(<Value>,< CompareChar>)
Value can be any string characters.
CompareChar: is the character that you want to get the position of. You can only supply a single character, and it is case sensitive.
This function will return -1, if CompareChar is not found in Value